<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Hello React</title>
</head>
<body>
	<div id="app">
		
	</div>
	<script src="//cdn.bootcss.com/react/15.4.2/react.js"></script>
	<script src="//cdn.bootcss.com/react/15.4.2/react-dom.js"></script>
	<script>
        var Component = React.createClass({
            propTypes:{
                // 指定props的类型
                name: React.PropTypes.string.isRequired
            },
            getDefaultProps: function () {
                // 默认属性
                return{
                    name: 'Bob'
                }
            },
            render: function () {
                return React.DOM.span(null, "My name is " + this.props.name);
            }
        });
		ReactDOM.render(
			React.createElement(Component, {
			    name: 'xinconan'
            }),
			document.getElementById("app")
		);
	</script>
</body>
</html>